import os
import sys

# 请在此输入您的代码

m = int(input())
d = int(input())

import datetime

try:
  res = datetime.date(2021,m,d)
  print('yes')
except:
  print('no')

